import LinkedList, {Node} from '../singleLinkList'
import Assert from '@/utils/assets'
import { getCenterLinkedList } from '../example/centerLinkList';
// 测试
export const test = () => {
    const ll = new LinkedList();
    const assert = new Assert();

    ll.add(1)
    ll.add(2)
    // ll.add(3)
    // ll.add(4)
    // ll.add(5)
    // ll.add(6)
    console.log(getCenterLinkedList(ll.getRoot()!))
    // print(ll)
    
}

/**
 * 打印 linkedList
 * @param ll 
 */
const print = (ll: LinkedList) => {
    let str = '';
    ll.forEach((element) => {
        str += `${element} -> `
    })
    str = str.substring(0, str.length - 3)
    console.log(str)
}